package com.example.redis.controller;

import com.example.redis.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class OrderController {
    @Autowired
    private OrderService orderService;

    @RequestMapping("/addOrder")
    public void addOrder() {
        orderService.addOrder();
    }

    @RequestMapping("/getOrderById/{key}")
    public String getOrderById(@PathVariable("key") String key) {
        return orderService.getOrderById(key);
    }
}
